import request from '@/utils/request'
const api_name = '/admin/system/sysMenu/'
export default {
    findNodes(page, limit, searchObj) {
        return request({
            url: `${api_name}findNodes`,
            method: 'get'
        })
    },
    removeById(id) {
        return request({
            url: `${api_name}remove/${id}`,
            method: 'delete'
        })
    },
    saveMenu(menu) {
        return request({
            url: `${api_name}save`,
            method: 'post',
            data: menu
        })
    },
    getById(id) {
        return request({
            url: `${api_name}findNode/${id}`,
            method: 'get'
        })
    }, updateMenu(menu) {
        return request({
            url: `${api_name}update`,
            method: 'post',
            data: menu
        })
    }, toAssign(roleId) {
        return request({
            url: `${api_name}/toAssign/${roleId}`,
            method: 'get'
        })
    },

    /*
    给某个角色授权
    */
    doAssign(assginMenuVo) {
        return request({
            url: `${api_name}/doAssign`,
            method: "post",
            data: assginMenuVo
        })
    }
}